import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity('recipes')
export class Recipe {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column({ length: 100 })
  name!: string;

  @Column({ length: 100 })
  title!: string;

  @Column('text')
  description!: string;

  @Column('text')
  ingredients!: string;

  @Column('text')
  instructions!: string;

  @Column({ default: 0 })
  cookingTime: number = 0;

  @Column({ default: 0 })
  servings!: number;

  @Column({ default: true })
  isActive!: boolean;

  @CreateDateColumn()
  createdAt!: Date;

  @UpdateDateColumn()
  updatedAt!: Date;
}
